﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MvcApplication.Common.Utility;

namespace CommonWebApiTest
{
    [TestClass]
    public class CommonTest1
    {
        [TestMethod]
        public void TestAes()
        {
            var value = "{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}{ewef:Here is some data to encrypt!!@#$%^&*,./;:'}";
            var secret = "tyudwefwew{}i";

            var a1 = AesUtil.Encryption(value, secret);
            var a2 = AesUtil.Decryption(a1, secret);

            //Assert.IsTrue(a1 == @"V3JmNuJDHERBj2kh77Yy9pbO6EpNzORSYs5WGV0tEk0FYJ97R/7ZMd1eWOpBhObK");
            Assert.IsTrue(a2 == value);
        }
    }
}
